<block name="header">
<header>
    <nav class="navbar navbar-default navbar-fixed-top">
        <div class="container">
            <div class="row">
                <div class="logo">
                    <a href="{:U('/')}" title="66Play">
                        <img src="__PUBLIC__/Home/ui3/images/logo.png" alt="logo">
                    </a>
                </div>
                <div class="logo2">
                    <a href="{:U('/')}" title="66Play">
                        <img src="__PUBLIC__/Home/ui3/images/logo2.png" alt="logo">
                    </a>
                </div>
                <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
                    <ul class="nav navbar-nav pull-left">
                        <li class="JS-header_btn">
                            <a href="/trends" title="主页">
                                <i class="li-img home"></i>
                                <div class="span">主页</div>
                            </a>
                        </li>
                        <li class="JS-header_btn">
                            <a href="/explore" title="探索">
                                <i class="li-img find"></i>
                                <div class="span">探索</div>
                            </a>
                        </li>
                        <li class="JS-header_btn JS-match">
                            <a href="/match" title="赛事">
                                <i class="li-img match"></i>
                                <div class="span">赛事</div>
                            </a>
                            <ul class="info-hide JS_match_popup font_micro black02-bg" style="top:80px">
                                <volist name="match_games" id="_game">
                                <li>
                                    <a href="/match-game-{$_game.id}" title="{$_game.name}">{$_game.name}</a>
                                </li>
                                </volist>
                            </ul>
                        </li>
                    </ul>
                </div>
                <div class="header-input col-xs-5 col-sm-5 col-md-5 col-lg-6">
                    <div class="input input-group input-group-nav">
                        <input type="text" class="form-control JS_header_search_input" id="input-search" name="key" placeholder="试试搜点儿什么..." title="试试搜点儿什么...">
                        <span class="input-group-btn JS_header_search">
                            <a role="button" class="search btn" aria-label="Left Align">
                                <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                            </a>
                        </span>
                    </div>
                </div>
                <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
                    <notempty name="userInfo">
                        <div class="down">
                            <div class="info-hide JS_popup">
                                <ul>
                                    <li title="我的动态">
                                        <a href="{:C('LOCAL_DOMAIN')}/user-{$Think.const.UID}">我的动态</a>
                                    </li>
                                    <li title="与我相关" onclick="warning()">
                                        <a href="javascript:void(0);">与我相关</a>
                                    </li>
                                    <li title="我的收藏">
                                        <a href="{:C('LOCAL_DOMAIN')}/favour-video">我的收藏</a>
                                    </li>
                                    <li title="退出登录" class="JS_logout">
                                        <a href="javascript:void(0);">退出登录</a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </notempty>
                    <ul class="nav navbar-nav pull-right">
                        <li class="JS-header_btn">
                            <a href="/download" title="下载">
                                <i class="li-img download-img"></i>
                                <div class="span">下载</div>
                            </a>
                        </li>
                        <notempty name="userInfo">
                            <li class="info-btn JS-header_btn">
                                <a href="javascript:;" title="{$userInfo.nickname}">
                                    <i class="li-img person-img ucenter"></i>
                                    <div class="span">{$userInfo.nickname}</div>
                                </a>
                            </li>
                        <else />
                            <li class="login-btn JS-header_btn" data-bind="click:loginShow">
                                <a href="javascript:void(0);" title="登录">
                                    <i class="li-img login-img"></i>
                                    <div class="span">登录</div>
                                </a>
                            </li>
                            <li class="register-btn JS-header_btn" data-bind="click:registerShow">
                                <a href="javascript:void(0);" title="注册">
                                    <i class="li-img person-img"></i>
                                    <div class="span">注册</div>
                                </a>
                            </li>
                        </notempty>
                    </ul>
                </div>
            </div>
        </div>
        <div class="top-shadow"></div>
    </nav>
</header>
<script type="text/javascript">
    $(function(){
        var currentTab = "{$currentTab}";
        if (currentTab != '') {
            $(".li-img."+currentTab).parents('li').addClass('active');
        }

        $('.JS_logout').click(function(){
            $.post('{:U('User/logout')}',{}, function(){
                location.reload();
            });
        });

        $('.JS_header_search').click(function(){
            var str = $('.JS_header_search_input').val();
            if (str.length > 0) {
                location.href = "/search?keywords="+str;
            }
        });
        $(".JS_header_search_input").keydown(function (e){
            if(e.which == "13"){
                $('.JS_header_search').click();
            }
        });

        $(".info-btn").click(function(){
            $(".JS_popup").fadeToggle();
            return false;
        });
        $(document).click(function(){
            $(".JS_popup").fadeOut();
        });
        $(".JS-match").mouseover(function(){
            if($(".JS_match_popup").css('display')=='none'){
                $(".JS_match_popup").slideDown("fast");
            }
        })
        $(".JS-match").mouseleave(function(){
            $(".JS_match_popup").slideUp("fast");
        })
    });

    function warning() {
        alert('功能暂未开通');
    }
</script>
</block>